from django.db import models

# Create your models here.

class User(models.Model):
    username = models.CharField(max_length=20, null=False, verbose_name="用户名")
    password = models.CharField(max_length=20, null=False, verbose_name="用户密码")
    email = models.CharField(max_length=30, null=False, verbose_name="用户邮箱地址")
    mobile = models.CharField(max_length=30, null=False, verbose_name="用户手机")

    class Meta:
        db_table = 'user'
        verbose_name = "用户表"
        verbose_name_plural = verbose_name


    def __str__(self):
        return self.username

    def to_dict(self):
        return {
            "username": self.username,
            "email": self.email,
            "mobile": self.mobile
        }

class GoodsType(models.Model):
    pass
    '''
        name = models.CharField(max_length=30, null=False, verbose_name="商品种类名称")
    type_mark = models.CharField(max_length=30, null=False, verbose_name="商品种类标记")
    image = models.ImageField(null=False, verbose_name="商品种类Logo")


    class Meta:
        db_table = 'goods_type'
        verbose_name = "商品种类"
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name
    '''



